#include "EffectAnimation.h"

CEffectAnimation::CEffectAnimation(string name, TGameObject* objTarget)
{
    int x = objTarget->GetMainSprite()->GetX() - objTarget->GetMainSprite()->GetOffsetX();
    int y = objTarget->GetMainSprite()->GetY() - objTarget->GetMainSprite()->GetOffsetY();
    spr = ResourceManager::CreateAnimation(name, x, y);

    spr->AnimateOnce();
}

CEffectAnimation::~CEffectAnimation(void)
{
    delete spr;
}

void CEffectAnimation::DoAction()
{
    spr->Update();
    if (spr->AnimationDone())
    {
        GameEngine::RemoveObject(this);
    }
}

float CEffectAnimation::GetCurrentSpeed()
{
    return 0.0f;
}

void CEffectAnimation::OnDraw()
{
    
}

TGDKSprite* CEffectAnimation::GetMainSprite()
{
    return NULL;
}
